<?php
/**
 * Created by PhpStorm.
 * User: Zhao
 * Date: 2017/3/4
 * Time: 13:52
 */

namespace Home\Controller;


use Common\Controller\BaseController;
use Think\Controller;

class PersonController extends BaseController
{
    public function queryAllPerson(){
        $personModel = M('Person');
        $list = $personModel->select();
        $this->ajaxReturn($list);
    }

    public function insertPerson(){
        $personModel = D('Person');
        if ($personModel->create()) {
            if ($personModel->add()) {
                $this->ajaxReturn('success');
            }else{
                $this->ajaxReturn('fail');
            }
        }
    }
}